const {M,app}=window;
const Db=M.Db();
M.doSql=M.Db().doSql;



M.doSql("select count(1) c from resource").catch(d=>{
    M.doSql(`
           CREATE TABLE user (
            id       INTEGER   PRIMARY KEY ASC AUTOINCREMENT,
            username CHAR (20),
            password CHAR (15) 
        );
`  );
    M.doSql(`
         CREATE TABLE resource (
            id        INTEGER       NOT NULL,
            name      VARCHAR (200) DEFAULT NULL,
            parent_id INTEGER       NOT NULL,
            res_url   VARCHAR (200) DEFAULT NULL,
            sort_num  BIGINT,
            PRIMARY KEY (
                id
            )
        );
`  );
});


app.begin((req,res)=>{console.log("===>",req.params)})
app.end((d)=>{console.log("<====",d)})
